﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Text;

namespace GiveGraphModel
{
    

    public class GiveGraphContext : DbContext
    {
        public DbSet<Category> Categories { get; set; }
        public DbSet<ServiceCategory> ServicesCategories { get; set; }
        public DbSet<OrganizationCategory> OrganizationCategories { get; set; }
        public DbSet<ProductCategory> ProductsCategories { get; set; }
        public DbSet<Resource> Resources { get; set; }


        public DbSet<Member> Members { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<Organization> Organizations { get; set; }

        public DbSet<SpecialtyArea> SpecialtyAreas { get; set; } 


        public DbSet<ServiceResponse> ServiceResponses { get; set; }
        public DbSet<ServiceRequest> ServiceRequest { get; set; }
        public DbSet<Service> Services { get; set; }
        


        public GiveGraphContext()
        {
            //Database.SetInitializer(new DropCreateDatabaseAlways<GiveGraphContext>());
            
        }

        
        
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new CategoryConfiguration());
            modelBuilder.Configurations.Add(new EventConfiguration());
            modelBuilder.Configurations.Add(new LocationConfiguration());
            modelBuilder.Configurations.Add(new OrganizationConfiguration());
            modelBuilder.Configurations.Add(new OrganizationLocationConfiguration());
            modelBuilder.Configurations.Add(new ProductConfiguration());
            modelBuilder.Configurations.Add(new ProductDonationConfiguration());//
            modelBuilder.Configurations.Add(new ResourceConfiguration());
            modelBuilder.Configurations.Add(new ScheduleConfiguration());
            modelBuilder.Configurations.Add(new ServiceConfiguration());
            modelBuilder.Configurations.Add(new ServiceRequestConfiguration());
            modelBuilder.Configurations.Add(new ServiceResponseConfiguration());
            modelBuilder.Configurations.Add(new UserConfiguration());
            modelBuilder.Configurations.Add(new SpecialtyAreaConfiguration());
            //  going here
            //



            //*/
        }

        
            
        
    }
}

